package cn.edu.xmu.ooad.shopppingcart;

import java.util.ArrayList;
import java.util.List;

public class ShoppingCartImmut {

    private List<String> items = new ArrayList<>();

    public void addItem(String item){
        items.add(item);
    }

    public int getDiscountPercentage(){
        if (items.size() >= 5){
            return 5;
        }else{
            return 0;
        }
    }

    public List<String> getItems(){
        return new ArrayList<>(this.items);
    }
}
